home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / RTLWIN16.PAK / CPL.H < prev    next >
C/C++ Source or Header  |  1997-05-06  |  6KB  |  162 lines

  1. /*****************************************************************************\
  2. *                                                                             *
  3. * cpl.h -       Control panel extension DLL definitions                       *
  4. *                                                                             *
  5. *               Version 3.10                                                  *
  6. *                                                                             *
  7. ******************************************************************************
  8. *  General rules for being installed in the Control Panel:
  9. *
  10. *      1) The DLL must export a function named CPlApplet which will handle
  11. *         the messages discussed below.
  12. *      2) If the applet needs to save information in CONTROL.INI minimize
  13. *         clutter by using the application name [MMCPL.appletname].
  14. *      2) If the applet is refrenced in CONTROL.INI under [MMCPL] use
  15. *         the following form:
  16. *              ...
  17. *              [MMCPL]
  18. *              uniqueName=c:\mydir\myapplet.dll
  19. *              ...
  20. *
  21. *
  22. *  The order applet DLL's are loaded by CONTROL.EXE is:
  23. *
  24. *      1) MAIN.CPL is loaded from the windows system directory.
  25. *
  26. *      2) Installable drivers that are loaded and export the
  27. *         CplApplet() routine.
  28. *
  29. *      3) DLL's specified in the [MMCPL] section of CONTROL.INI.
  30. *
  31. *      4) DLL's named *.CPL from windows system directory.
  32. *
  33. */
  34.  
  35. /* $Copyright: 1994$ */
  36.  
  37. #ifndef _INC_CPL
  38. #define _INC_CPL
  39. #define __CPL_H
  40.  
  41. #include "pshpack1.h"
  42.  
  43. #ifdef __cplusplus
  44. extern "C" {            /* Assume C declarations for C++ */
  45. #endif /* __cplusplus */
  46.  
  47. /*
  48.  * CONTROL.EXE will answer this message and launch an applet
  49.  *
  50.  * WM_CPL_LAUNCH
  51.  *
  52.  *      wParam      - window handle of calling app
  53.  *      lParam      - LPTSTR of name of applet to launch
  54.  *
  55.  * WM_CPL_LAUNCHED
  56.  *
  57.  *      wParam      - TRUE/FALSE if applet was launched
  58.  *      lParam      - NULL
  59.  *
  60.  * CONTROL.EXE will post this message to the caller when the applet returns
  61.  * (ie., when wParam is a valid window handle)
  62.  *
  63.  */
  64. #define WM_CPL_LAUNCH   (WM_USER+1000)
  65. #define WM_CPL_LAUNCHED (WM_USER+1001)
  66.  
  67. /* A function prototype for CPlApplet() */
  68.  
  69. typedef LRESULT (CALLBACK *APPLET_PROC)(HWND hwndCpl, UINT msg, LPARAM lParam1, LPARAM lParam2);
  70.  
  71. /* The data structure CPlApplet() must fill in. */
  72.  
  73. typedef struct tagCPLINFO
  74. {
  75.     int     idIcon;     /* icon resource id, provided by CPlApplet() */
  76.     int     idName;     /* name string res. id, provided by CPlApplet() */
  77.     int     idInfo;     /* info string res. id, provided by CPlApplet() */
  78.     LONG    lData;      /* user defined data */
  79. } CPLINFO, *PCPLINFO, FAR *LPCPLINFO;
  80.  
  81. typedef struct tagNEWCPLINFO
  82. {
  83.     DWORD       dwSize;         /* similar to the commdlg */
  84.     DWORD       dwFlags;
  85.     DWORD       dwHelpContext;  /* help context to use */
  86.     LONG        lData;          /* user defined data */
  87.     HICON       hIcon;          /* icon to use, this is owned by CONTROL.EXE (may be deleted) */
  88.     char        szName[32];     /* short name */
  89.     char        szInfo[64];     /* long name (status line) */
  90.     char        szHelpFile[128];/* path to help file to use */
  91. } NEWCPLINFO, *PNEWCPLINFO, FAR *LPNEWCPLINFO;
  92.  
  93. /* The messages CPlApplet() must handle: */
  94.  
  95. #define CPL_INIT        1
  96. /*  This message is sent to indicate CPlApplet() was found. */
  97. /*  lParam1 and lParam2 are not defined. */
  98. /*  Return TRUE or FALSE indicating whether the control panel should proceed. */
  99.  
  100.  
  101. #define CPL_GETCOUNT    2
  102. /*  This message is sent to determine the number of applets to be displayed. */
  103. /*  lParam1 and lParam2 are not defined. */
  104. /*  Return the number of applets you wish to display in the control */
  105. /*  panel window. */
  106.  
  107.  
  108. #define CPL_INQUIRE     3
  109. /*  This message is sent for information about each applet. */
  110. /*  lParam1 is the applet number to register, a value from 0 to */
  111. /*  (CPL_GETCOUNT - 1).  lParam2 is a far ptr to a CPLINFO structure. */
  112. /*  Fill in CPL_INFO's idIcon, idName, idInfo and lData fields with */
  113. /*  the resource id for an icon to display, name and description string ids, */
  114. /*  and a long data item associated with applet #lParam1. */
  115.  
  116.  
  117. #define CPL_SELECT      4
  118. /*  This message is sent when the applet's icon has been clicked upon. */
  119. /*  lParam1 is the applet number which was selected.  lParam2 is the */
  120. /*  applet's lData value. */
  121.  
  122.  
  123. #define CPL_DBLCLK      5
  124. /*  This message is sent when the applet's icon has been double-clicked */
  125. /*  upon.  lParam1 is the applet number which was selected.  lParam2 is the */
  126. /*  applet's lData value. */
  127. /*  This message should initiate the applet's dialog box. */
  128.  
  129.  
  130. #define CPL_STOP        6
  131. /*  This message is sent for each applet when the control panel is exiting. */
  132. /*  lParam1 is the applet number.  lParam2 is the applet's lData  value. */
  133. /*  Do applet specific cleaning up here. */
  134.  
  135.  
  136. #define CPL_EXIT        7
  137. /*  This message is sent just before the control panel calls FreeLibrary. */
  138. /*  lParam1 and lParam2 are not defined. */
  139. /*  Do non-applet specific cleaning up here. */
  140.  
  141.  
  142. #define CPL_NEWINQUIRE    8
  143. /* this is the same as CPL_INQUIRE execpt lParam2 is a pointer to a */
  144. /* NEWCPLINFO structure.  this will be sent before the CPL_INQUIRE */
  145. /* and if it is responed to (return != 0) CPL_INQUIRE will not be sent */
  146.  
  147. #define CPL_DO_PRINTER_SETUP    100    /* ;Internal */
  148. #define CPL_DO_NETPRN_SETUP     101    /* ;Internal */
  149.  
  150. /* This message is internal to the Control Panel and MAIN applets.  */
  151. /* It is only sent when an applet is invoked from the Command line  */
  152. /* during system installation.                                      */
  153. #define CPL_SETUP               200
  154.  
  155. #ifdef __cplusplus
  156. }
  157. #endif    /* __cplusplus */
  158.  
  159. #include "poppack.h"
  160.  
  161. #endif  /* _INC_CPL */
  162.